﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Acms.Bll;
using Acms.AcmsControls;

public partial class Templates_Person_ExploreMain : BaseTemplateUserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void acmsPosition_DataBound(object sender, EventArgs e)
    {
        ulPosition.Visible = !acmsPosition.IsEmpty;
    }

    protected override void DataBindChildren()
    {
        PostControl emailControl = AcmsContext.CurrentPost.FindPostControl("Email");
        if (emailControl != null)
        {
            TextContentControlProperties prop = emailControl.GetProperties<TextContentControlProperties>();
            if (prop != null && !string.IsNullOrEmpty(prop.Text))
            {
                lnkEmail.Text = prop.Text;
                lnkEmail.NavigateUrl = string.Concat("mailto:", prop.Text);
            }
            else
            {
                lnkEmail.Visible = false;
            }
        }
        base.DataBindChildren();
    }
}
